<?php


namespace app\controller;


class home extends \myphp\controller
{

    public function index() {

        // 调用模型类获取数据
//        $res = \myphp\Factory::getModel('user')->create();
        $db = \myphp\Factory::getDb('master');
        $result = $db->query('select * from rm_about where typeid=2')->fetch_assoc();
        //$res = $db->mysqli_fetch_all($result,MYSQLI_ASSOC);
//        var_dump($result);
//        die;

        $this->assign("dates",[["name"=>"fuchao","age"=>19],["name"=>"fuchao2","age"=>20],["name"=>"fuchao3","age"=>21]]);
        $this->assign("title","网站首页");
        $this->display();
        //return 'hello ;fuchao';
    }

}